#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const ll mod = 1e9 + 7;;

ll n, s, ans;
ll a[1100];
char c[1100];
bitset<55> p1, p2, p3;

ll qpow(ll x, ll y) {
	if (!y) {
		return 1;
	}
	ll ss = qpow(x, y >> 1);
	if (y & 1) {
		return ss * ss % mod * x % mod;
	} else {
		return ss * ss % mod;
	}
}

int main() {
	freopen("bracket.in", "r", stdin);
	freopen("bracket.out", "w", stdout);
	scanf("%lld", &n);
	scanf("%s", c + 1);
	for (ll i = 1; i <= n; i++) {
		if (c[i] == 'x') {
			s++;
			a[s] = i;
		}
	}
	if (n & 1) {
		printf("0\n");
		return 0;
	}
	if (n <= 100 && s <= 20) {
		for (ll i = 0; i < (1 << s); i++) {
			for (ll j = 1; j <= s; j++) {
				if ((i >> (j - 1)) & 1) {
					c[a[j]] = ')';
				} else {
					c[a[j]] = '(';
				}
			}
			p1 = 0;
			p2 = 0;
			p3 = 0;
			p1[0] = 1;
			for (ll j = 1; j <= n; j++) {
				p2 |= p1;
				p3 |= p2;
				if (c[j] == '(') {
					p2 >>= 1;
					p1 <<= 1;
					p3 <<= 1;
				} else {
					p2 <<= 1;
					p1 >>= 1;
					p3 >>= 1;
				}
				if (p2 == 0 && p3 == 0) {
					break;
				}
			}
			p2 |= p1;
			p3 |= p2;
			if (p3[0]) {
				ans++;
			}
		}
		printf("%lld\n", ans);
		return 0;
	}
	return 0;
}
